/**
 * Created with IntelliJ IDEA
 * Description:
 * User: Administrator
 * Data: 2023 - 05 - 23
 * Time: 21:59
 */
class ListNode3 {
    int val;
    ListNode3 next = null;

    ListNode3(int val) {
        this.val = val;
    }
}
public class Practice3 {
    public ListNode3 FindKthToTail(ListNode3 head,int k) {
        if((head == null) || (k <= 0)) return null;
        ListNode3 fast = head;
        ListNode3 show = head;
        for (int i = 0; i < k - 1; i++) {
            fast = fast.next;
            if(fast == null) {
                return null;
            }
        }
        while(fast.next != null) {
            fast = fast.next;
            show = show.next;
        }
        return show;
    }
}
